# 给定一个字符串，请你找出其中不含有重复字符的
# https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/

class Solution:
    def lengthOfLongestSubstring(self, s: str) -> int:
        '''
        给一个字符串，返回最大不重复子串
        :param s:
        :return:
        '''

        strLength = len(s)
        maxLength = 0
        for index, num in enumerate(s):
            if (strLength-index)<maxLength:
                break
            combination = set()
            for subIndex, subNum in enumerate(s[index:strLength]):
                if subNum in combination:
                    break;
                combination.add(subNum)
                if(maxLength<len(combination)):
                    maxLength = len(combination)
        return maxLength


solution = Solution()
print(solution.lengthOfLongestSubstring(""))


